package com.vicene.gmail.product.web;

import com.vicene.gmail.product.service.SkuInfoService;
import com.vicene.gmail.product.vo.SkuItemVo;
import org.bouncycastle.math.raw.Mod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.concurrent.ExecutionException;

@Controller
public class ItemController {
    @Autowired
    SkuInfoService skuInfoService;

    @RequestMapping("/{skuId}.html")
    public String skuItem(@PathVariable("skuId") Long skuId  , Model model) throws ExecutionException, InterruptedException {
        //skuId = 3l;
        //catalogId = 225l;
        SkuItemVo vo = skuInfoService.item(skuId );
        model.addAttribute("item" , vo);
        System.out.println("查询sku" + skuId);
        return "item";
    }
}
